package com.example.data.factory.web1.controller;

import com.example.data.factory.common.Dto.LoginDto;
import com.example.data.factory.common.result.R;
import com.example.data.factory.entity.entity.Personnel;
import com.example.data.factory.service.service.PersonnelService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/personner")
public class PersonnelController {
    @Resource
    private PersonnelService personnelService;

    @GetMapping("login")
    public R<Personnel> login(LoginDto loginDto) {
        return personnelService.serach ( loginDto );
    }

    @GetMapping("/detail")
    public R detail(HttpServletRequest request) {
        return personnelService.getAccount ( request );
    }
}


